#pragma once 

#include <string>
#include <system_error>
#include <optional>
#include "helper/resource/ReopenableResource.h"


namespace helper {
namespace sqlite {

class Statement;

class IDB  : public helper::resource::ReopenableResource<std::error_code> {
public:
  explicit IDB(const std::string & url) : _url(url) {}
  virtual ~IDB(){}

  virtual std::optional<Statement> createStatement(const std::string & sql, std::error_code & ec) const = 0;

  virtual const std::string & url() const {
    return _url;
  }

  virtual void * raw_handler() const = 0;

private:
  std::string _url;
};

}//namespace sqlite
}//namespace helper
